package app.demo;

import java.net.MalformedURLException;

import com.caucho.hessian.client.HessianProxyFactory;

/**
 * Hello world!
 * 
 */
public class BasicClient {
	public static void main(String[] args) {
		String url = "http://127.0.0.1:8080/HessianServer/hello";
		HessianProxyFactory factory = new HessianProxyFactory();
		try {
			BasicAPI api = (BasicAPI) factory.create(url);
			System.out.println("Hello:" + api.hello());
//			api.setGreeting("test greeting");
//			System.out.println("Hello:" + api.hello());
			User user = api.getUser();
			System.out.println("Hello: Username = " + user.getUserName()
					+ " Password = " + user.getPassword());
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}
}
